<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>{$site_name}</title>
<!-- CSS -->
<link rel="stylesheet" href="{url:#css/materialize.min.css}" />
<link rel="stylesheet" href="{url:#css/me.css}" />
<link rel="stylesheet" href="{url:#css/iconfont.css}" />

<style type="text/css">
/**去除绿色下划线 - 开始*/
input::-webkit-input-placeholder {
    color: black;
    text-indent: 5px;
}
input:not([type]),input[type=text],input[type=password],input[type=email],input[type=url],input[type=time],input[type=date],input[type=datetime-local],input[type=tel],input[type=number],input[type=search],textarea.materialize-textarea{background-color:transparent;border:none;border-radius:0;outline:none;height:3rem;width:100%;font-size:1rem;margin:0;padding:0;box-shadow:none;}
input:not([type]):focus:not([readonly]),input[type=text]:focus:not([readonly]),input[type=password]:focus:not([readonly]),input[type=email]:focus:not([readonly]),input[type=url]:focus:not([readonly]),input[type=time]:focus:not([readonly]),input[type=date]:focus:not([readonly]),input[type=datetime-local]:focus:not([readonly]),input[type=tel]:focus:not([readonly]),input[type=number]:focus:not([readonly]),input[type=search]:focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border:none;nox-shadow:none;}
input:not([type]):focus:not([readonly])+label,input[type=text]:focus:not([readonly])+label,input[type=password]:focus:not([readonly])+label,input[type=email]:focus:not([readonly])+label,input[type=url]:focus:not([readonly])+label,input[type=time]:focus:not([readonly])+label,input[type=date]:focus:not([readonly])+label,input[type=datetime-local]:focus:not([readonly])+label,input[type=tel]:focus:not([readonly])+label,input[type=number]:focus:not([readonly])+label,input[type=search]:focus:not([readonly])+label,textarea.materialize-textarea:focus:not([readonly])+label{color:transparent;box-shadow:none;}
input:not([type]):focus:not([readonly]),input[type=text]:focus:not([readonly]),input[type=password]:focus:not([readonly]),input[type=email]:focus:not([readonly]),input[type=url]:focus:not([readonly]),input[type=time]:focus:not([readonly]),input[type=date]:focus:not([readonly]),input[type=datetime-local]:focus:not([readonly]),input[type=tel]:focus:not([readonly]),input[type=number]:focus:not([readonly]),input[type=search]:focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border-bottom:none;box-shadow:none}
/**去除绿色下划线 - 结束*/
</style>
<!-- JS -->
<script src="{url:#js/jquery-1.11.3.min.js}"></script>
<script src="{url:#js/materialize.min.js}"></script>
<script src="{url:#js/home/login.js}"></script>
<script src="{url:#js/yang_check.js}"></script>
</head>
<body>
<!-- TitleBar 开始 -->
<div class="navbar-fixed">
  <nav>
    <div class="nav-wrapper red accent-4 valign-wrapper">
      <ul class="left" id="nav-btn-left">
        <li><a href="javascript:window.history.go(-1);"><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
      <span class="title-bar-size center_align">登陆</span>
      <ul class="right">
        <li><a  class="disabled" style="visibility:hidden"><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
    </div>
  </nav>
</div>
<!-- TitleBar 结束 -->

<div class="container">
	<div class="center" style="margin-top:30px;">
		<img src="{url:#images/login_user_default_icon.png}" width="100" height="100" class="circle" style="background-color:white" />
	</div>
	<ul class="login-bor">
		<li><input type="text" name="username" id="username" placeholder="用户名"/></li>
		<li><div class="divider"></div></li>
		<li><input type="password" name="password" id="password" placeholder="密码"/></li>
	</ul>
	<div class="center clearfix" style="margin-right:10px; margin-left:10px;">
		<a class="waves-effect waves-light btn-large red z-depth-0 login_btn" href="javascript:;" id="btn_login">登  陆</a>
		
	</div>
	<div style="margin-top:20px; margin-right:10px; margin-left:10px;">
		<!-- 
		<a href="#" class="left red-text">找回密码</a>
		-->
		<a class="right red-text" href="{url:/mobile/register}">立即注册</a>
	</div>
</div>


<script type="text/javascript">
$(function(){
	$("#btn_login").click(function(){

		var username = $.trim($("#username").val());
		if( username == '' )
		{
			yang_alert("用户名不能为空");
			//NativeBinder.nativeToast("{'msg':'用户名不能为空','ms':0}");
			return false;
		}

		var password = $("#password").val();
		if( password == '' )
		{
			yang_alert('密码不能为空');
			//NativeBinder.nativeToast("{'msg':'密码不能为空','ms':0}");
			return false;
		}
		
		/*
		var user_pattern = /[a-zA-Z0-9]{6,}/i;
		if(!user_pattern.test(username))
		{
			//alert('用户名不合法(至少6位字母、数字组合)');
			NativeBinder.nativeToast("{'msg':'用户名不合法(至少6位字母、数字组合)','ms':0}");
			return false;
		}
		*/

		var password_pattern = /[a-zA-Z0-9]{6,20}/i;
		if( !password_pattern.test(password) )
		{
			yang_alert('您输入的密码不合法(6~20位字母、数字组合)');
			//NativeBinder.nativeToast("{'msg':'您输入的密码不合法(6~20位字母、数字组合)','ms':0}");
			return false;
		}

		
		$.post('{url:/mobile/login_act}',{username:username,password:password},function(data){
	        if(data['status']=='success')
		    {
			    //个人中心页面
	            location.href="{url:/mobile/user_center}";
	        }
	        else
		    {
			    var msg = data['msg'];
	            yang_alert(data['msg']);
	            //NativeBinder.nativeToast("{'msg':'"+msg+"','ms':0}");
	        }
	      },'json');
	      
	});
});
	
</script>

</body>
</html>